<?php
echo "10.0.0.55:88 response time ".pingDomain("10.0.0.55")." sec";
function pingDomain($domain){
    $starttime = microtime(true);
    // supress error messages with @
    $file      = @fsockopen($domain, 88, $errno, $errstr, 10);
    $stoptime  = microtime(true);
    $status    = 0;

    if (!$file){
        $status = -1;  // Site is down
    }
    else{
        fclose($file);
        $status = ($stoptime - $starttime) * 1000;
        $status = floor($status);
    }
    if ($status/1000 > 5)
    {
    	$log = date("H:i:s")."-".$_SESSION["RACCOUNT_ID"];
	    error_log($log.": ".($status/1000)." sec".PHP_EOL, 3, "D:/AppServ/www/tosorderbackup/log/rpt".date("Ymd").".log");	
	}
    return $status/1000;
}
?>